<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>博客管理</title>
    <!-- 公共CSS,JS文件 -->
    <#include "../../admin/common/header.ftl"/>
</head>
<body>
<div class="container-fluid">
    <!-- 左右侧导航 -->
    <div class="row">
        <!-- 右侧导航 -->
        <div class="col-xs-12">
            <div class="panel">
                <div class="panel-heading">博客管理</div>
                <!-- 添加mdal -->
                <div class="modal fade" id="addModal" <#--tabindex="-1"--> role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog modal-fullscreen">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">新增博客</h4>
                            </div>
                            <div class="modal-body">
                                <form id="addForm" action="/admin/blog/save" method="post" class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">博客标题</label>
                                        <div class="col-sm-5">
                                            <input type="text" class="form-control" name="title" style="width:700px;"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">博客内容</label>
                                        <div class="col-sm-5">
                                            <textarea id="content" name="content" cols="100" rows="8" style="width:700px;height:1000px;visibility:hidden;"></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-5 col-sm-offset-3">
                                            <button type="submit" class="btn btn-primary">保存</button>
                                            <button type="button" class="btn btn-primary" id="resetBtn" >取消</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 修改modal -->
                <div class="modal fade" id="editModal" <#--tabindex="-1"--> role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog modal-fullscreen">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">修改博客</h4>
                            </div>
                            <div class="modal-body">
                                <!-- The form is placed inside the body of modal -->
                                <form id="editForm" action="/admin/blog/edit" method="post" class="form-horizontal">
                                    <input type="hidden" id="id" name="id" value="">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">博客标题</label>
                                        <div class="col-sm-5">
                                            <input type="text" class="form-control" name="title" id="title" value="" style="width:700px;"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">博客内容</label>
                                        <div class="col-sm-5">
                                            <textarea id="ucontent" name="content" cols="100" rows="8" style="width:700px;height:1000px;visibility:hidden;"></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-5 col-sm-offset-3">
                                            <button type="submit" class="btn btn-primary">修改</button>
                                            <button id="editResetBtn" type="button" class="btn btn-primary">取消</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <#--内容-->
                <div class="panel-body">
                    <div class="row">
                        <!-- 搜索框 -->
                        <form action="/admin/blog/list" method="post">
                            <div class="col-xs-3">
                                <input type="text" id="searchParam" name="searchParam" value="${searchParam!}" class="form-control" placeholder="关键字">
                            </div>
                            <div class="col-xs-2">
                                <input type="text" name="startDate" value="${startDate!}" class="form-control form-date" placeholder="开始时间" readonly="readonly">
                            </div>
                            <div class="col-xs-2">
                                <input type="text" name="endDate" value="${endDate!}" class="form-control form-date" placeholder="结束时间" readonly="readonly">
                            </div>
                            <div class="col-xs-2">
                                <button class="btn btn-primary" type="submit">搜索</button>
                            </div>
                        </form>
                    </div>
                    <div id="toolbar" class="toolbox btn-group" style="padding-top:10px; padding-bottom:10px;">
                        <div class="tools-group">
                            <#--<@shiro.hasPermission name="admin:member:add">-->
                                <button class="btn btn-primary" data-toggle="modal" data-target="#addModal"><i class="icon icon-plus"></i>添加</button>
                            <#--</@shiro.hasPermission>
                            <@shiro.hasPermission name="admin:member:delete">-->
                                <button class="btn btn-danger" onclick="optDelete()"><i class="icon icon-times"></i> 删除</button>
                            <#--</@shiro.hasPermission>-->
                        </div>
                    </div>
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th><input type="checkbox" onclick="checkBox('ids',this.checked)"/></th>
                            <th>编号</th>
                            <th>标题</th>
                            <th>创建时间</th>
                            <th>修改时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            <#if page.list??>
                                <#list page.list as blogVo>
                                    <tr>
                                        <th><input type="checkbox" class="checked_detect" value="${blogVo.id!?c }" name="ids"/></th>
                                        <th>${blogVo_index+1!}</th>
                                        <th>${blogVo.title!}</th>
                                        <th>${blogVo.tsInsert!}</th>
                                        <th>${blogVo.tsUpdate!}</th>
                                        <th>
                                            <button class="btn btn-primary" onclick="editNode('${blogVo.id!?c }')">编辑</button>
                                            <button class="btn btn-danger" onclick="deleteNode('${blogVo.id!?c }')">删除</button>
                                        </th>
                                    </tr>
                                </#list>
                            </#if>
                        </tbody>
                    </table>
                    <!-- 分页 start -->
                    <#include "../../admin/common/page.ftl"/>
                    <!-- 分页 end -->
                </div>
            </div>
        </div>
    </div>
<#--底部-->
<#include "../../admin/common/footer.ftl"/>
</div>
<#--导入blogList.js文件-->
<script src="/static/zui/js/blog/blogList.js"></script>
</body>
</html>